package com.youpai.platform.vulture.service.util;

import com.youpai.platform.common.enums.ProcessCodeEnum;
import com.youpai.platform.common.exceptions.BaseParamException;
import com.youpai.platform.vulture.service.constant.BizConstants;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

/**
 * @date: 2022/7/9 21:42
 * @author: Anna
 * @version: 1.0
 * @description: 缓存key工具类
 */
@Slf4j
public class CacheKeyUtil {

    /**
     * 获取vulture握手token工具
     *
     * @param deviceId 设备id
     * @return cache key
     */
    public static String getHandShakeToken(String deviceId) {
        if (StringUtils.isBlank(deviceId)) {
            throw new BaseParamException(ProcessCodeEnum.PARAM_ERROR);
        }
        return BizConstants.VULTURE_CACHE_KEY_PRE + deviceId;
    }

}
